<?php


namespace app\lunwen\controller;


use app\lunwen\model\LeaveMessageModel;
use cmf\controller\HomeBaseController;

class TeacherShowMessageController extends HomeBaseController
{
    public function index(){
        $file = new LeaveMessageModel();
        $data = $file->whereor("receive_people",session("teacher_name"))
            ->whereor("send_people",session("teacher_name"))
            ->whereTime('create_time','>',session('beforeYear'))
            ->whereTime('create_time','<',session('afterYear'))
            ->all();
        $this->assign('title',$data);

        return $this->fetch(":teacherShowMessage");
    }

    public function down(){
        $back_file_path = $_GET['file_path'];
        $data = "D:\\phpstudy_pro\\thinkcmf\\ThinkCMF\\public\\$back_file_path";
        echo $filename = $back_file_path;
        return \download($data,$_GET["file_name"],false);
    }
}